package com.ryskoo.cms.notice.repository;

import com.ryskoo.cms.notice.domain.NoticePO;
import com.ryskoo.framework.core.repository.BasicRedisImpl;
import com.ryskoo.framework.core.utils.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Repository;

import javax.annotation.PostConstruct;

/**
 * @author renyuting
 * @data 2018-05-03
 */
@Primary
@Repository
public class NoticeRedisImpl extends BasicRedisImpl<NoticePO> implements INoticeRepository{

    private static final String KEY_PRE = "CMS_NOTICE_";

    @Autowired
    private RedisUtil redisClient;

    @Autowired
    private INoticeRepository noticeRepository;

    @PostConstruct
    public void init() {
        this.setRedisClient(redisClient);
        this.setDao(noticeRepository);
    }

    public NoticeRedisImpl() {
        super(KEY_PRE);
    }
}
